<!--{include header.htm}-->

<div class="width">
	<form action="?banip-index.htm" method="post" id="banip_form">
		<input type="hidden" name="FORM_HASH" value="{FORM_HASH}" />
		<div class="div">
			<div class="header">禁止IP设置</div>
			<div class="body">
				<dl>
					<dt><label for="iptable_on">开启IP过滤：</label></dt>
					<dd>$input[iptable_on]</dd>
				</dl>
			</div>
			<div class="footer"></div>
		</div>
			
		<div class="list">
			<table class="table">
				<tr class="header">
					<td colspan="5">禁止的IP列表</td>
				</tr>
				<tr>
					<td></td>
					<td>IP地址</td>
					<td>操作人</td>
					<td>起始时间</td>
					<td>终止时间</td>
				</tr>
				<!--{loop $baniplist $banip}-->
				<tr class="ip">
					<td>
						<input type="checkbox" value="$banip[banid]" name="delete[]" size="6" />
					</td>
					<td>
						<input type="text" value="$banip[ip0]" name="banip[$banip[banid]][ip0]" size="3" /> -
						<input type="text" value="$banip[ip1]" name="banip[$banip[banid]][ip1]" size="3" /> -
						<input type="text" value="$banip[ip2]" name="banip[$banip[banid]][ip2]" size="3" /> - 
						<input type="text" value="$banip[ip3]" name="banip[$banip[banid]][ip3]" size="3" />
					</td>
					<td>
						$banip[username]
					</td>
					<td>
						$banip[dateline_fmt]
					</td>
					<td>
						<input type="text" value="$banip[expiry_fmt]" name="banip[$banip[banid]][expiry_fmt]" size="12" />
					</td>
				</tr>
				<!--{/loop}-->
				<tr class="ip">
					<td></td>
					<td>
						<input type="text" value="" name="newbanip[ip0][]" size="3" /> -
						<input type="text" value="" name="newbanip[ip1][]" size="3" /> -
						<input type="text" value="" name="newbanip[ip2][]" size="3" /> -
						<input type="text" value="" name="newbanip[ip3][]" size="3" /> -
					</td>
					<td>
						$_user[username]
					</td>
					<td>
						$currtime
					</td>
					<td>
						<input type="text" value="$nexttime" name="newbanip[expiry_fmt][]" size="12" />
					</td>
				</tr>
			</table>
			<p>&nbsp; <input type="checkbox" value="1" name="checkall" id="checkall" />全选 <a href="javascript:void(0)" id="add">[+]增加</a></p>
			<br />
			<p>&nbsp; IP地址格式为：192.169.1.1</p>
			<p>&nbsp; IP地址段格式为：192.169.1.*</p>
		</div>
		<div style="text-align: center; margin-top: 8px;">
			<input type="submit" class="button bigblue" id="banip_submit" value="确认设置" />
			<input type="button" class="button biggrey" value="取消" onclick="history.back()" />
			<div id="notice" class="notice" style="display: none;"></div>
		</div>
	</form>
	
</div>

<!--{include footer.htm}-->

<script type="text/javascript">

$('#add').click(function() {
	var jclone = $('tr.ip:last').clone().appendTo($('tr.ip').parent());
	$('input[name^=newbanip\[ip]', jclone).attr('value', '');
	
});

$('#checkall').click(function() {
	$('input[name^=delete]').attr('checked', this.checked);
});

$('#banip_submit').click(function() {
	$('#banip_form').submit();
	return false;
});

<!--{if !empty($_POST) && empty($error)}-->
	$('#notice').html('设置成功！').show();
<!--{/if}-->


</script>
</body>
</html>